1. Field of the Invention
The present invention relates to a numerical control apparatus for controlling a machine tool.
2. Description of the Related Art
As for a machine tool controlled by a numerical control apparatus, a machining program in the case of forming a work shape generally comprises a plurality of programs such as roughing, semi-finishing and finishing programs. To reduce machining time, it is necessary to change machining conditions such as a command speed, and there are many cases where such a change should be made in detail in a desired program. For that purpose, it is necessary to measure the time required for various kinds of machining and look for a process capable of time reduction.
Concerning information on the time for program operation of prior art numerical control apparatus in the past, there is prepared information such as recorded information on program start time by means of an operation history function or time information capable of checking accumulated time in a specific operational status including automatic operation time and cutting time by means of an operating time display function. For instance, Japanese Patent Application Laid-Open No. 2001-34317 discloses a unit for detecting and storing a history for each component as to start time, completion time, machine tool operation start time and stop time and seeking operating time for each component.
Japanese Patent Application Laid-Open No. 10-143220 discloses a unit for measuring, storing and displaying operation set-up time, machining time and alarm time of the machine tool.
As described above, the prior art technology detects, stores and displays operating time and alarm stop time of the machine tool and machining time for every component. It is intended to grasp and control a current status of work rather than to detect the machining time and so on for each command of the program executed by the numerical control apparatus. For that reason, the prior art technology does not provide a criterion for reviewing and improving the machining program for the sake of reducing the machining time.
There may be a command, such as a custom macro command, in a machining program, which a user performs calculation of the machining conditions and so on, prior to actually performing machining by operating the machine with the machining program. In program execution of the custom macro command, there will be a difference in execution time due to a mechanism of an analytic process of the numerical control apparatus depending on how a custom macro program is created. For that reason, it is necessary to modify and improve the program so as to enable processing in an optimum and short time. Thus, it may be an important clue to program modification to acquire a time necessary for processing of a specific program such as a custom macro program.
Variables capable of reading the time information are prepared as macro variables. Even in that case, however, it is necessary to create a macro program for obtaining necessary time information by adding a macro program unrelated to a machining program command to an existing machining program. In addition, various output signals for notifying an operational status are prepared. However, it is necessary, as in the case of the macro variables, to create application software for detecting a change in a signal status by using a user application such as a PMC (programmable machine controller) ladder sequence. And it requires knowledge and efforts for creating the PMC ladder sequence. The above-mentioned various output signals for notifying the operational status are not sufficient for obtaining accurate time information since there is a time delay as a signal interface.
A first form of a numerical control apparatus for controlling a machine tool according to the present invention comprises: means for setting and registering any command, selected from among a plurality of commands described in a program handled by the numerical control apparatus, as a time data command for storing a time at which original contents of the command are executed; clock means for updating a current time and outputting an updated current time; determination means for determining whether or not the command read from the program during execution of the program is a time data command set and registered; time data storage means; and means for, when the read command is determined to be the time data command by said determination means, acquiring the current time from the clock means, apart from execution of the original contents of the command, and writing the acquired time as an execution time to said time data storage means. It is possible, with the numerical control apparatus in this form, to know the execution time of the arbitrarily selected program command.
A second form of the numerical control apparatus for controlling the machine tool according to the present invention comprises: means for setting and registering any command, selected from among a plurality of commands described in a program handled by the numerical control apparatus, as a reference time data command for storing a time at which original contents of the command are executed as a reference time; means for setting and registering a command, different from said selected command, as an elapsed time data command for storing elapsed time from the reference time at which the original contents of the command are executed; clock means for updating a current time and outputting an updated current time; determination means for determining whether or not a command read from the command program during execution of the program is a command set and registered; time data storage means; means for, when determined to be the reference time data command set and registered by the determination means, acquiring the current time from the clock means, apart from execution of the original contents of the command, and writing the acquired time to a time data storage means as a reference time; and means for, when determined to be the elapsed time data command set and registered by the determination means, acquiring the current time from the clock means apart from the execution of the original contents of the command, calculating the elapsed time from the current time and the reference time and writing the calculated time to said time data storage means as an execution elapsed time. It is possible, with the numerical control apparatus in this form, to know the execution elapsed time.
A third form of the numerical control apparatus for controlling the machine tool according to the present invention comprises: means for setting and registering any command, selected from among a plurality of commands described in a command program handled by the numerical control apparatus, as an elapsed time data command for storing elapsed time; timekeeping means for measuring time; determination means for determining whether or not the command read from the command program during execution of the command program is a elapsed time data command set and registered; time data storage means; and means for, when determined to be the elapsed time data command by the determination means, acquiring the elapsed time from the execution time of the last elapsed time data command, apart from the execution of the original contents of the elapsed time data command, based on said timekeeping means and writing the acquired time to said time data storage means as execution elapsed time.
A fourth form of the numerical control apparatus for controlling the machine tool according to the present invention comprises: means for setting and registering any command, selected from among a plurality of commands described in a command program handled by the numerical control apparatus, as a reference time data command for storing the time at which the original contents of the command are executed as a reference time; means for setting and registering a command, different from the selected command, as an elapsed time data command for storing elapsed time from the reference time at which original contents of the command are executed; timekeeping means for measuring time; determination means for determining whether or not the command read from the command program during the execution of the program is a command set and registered; time data storage means; means for, when determined to be the reference time data command by the determination means, causing the timekeeping means to start measuring time, apart from the execution of the original contents of the command; and means for, when determined to be the elapsed time data command set and registered by the determination means, acquiring the elapsed time measured by the timekeeping means, apart from the execution of the original contents of the command, and writing the acquired time to said time data storage means.
As for the numerical control apparatus in the fourth form, the timekeeping means may be comprised of clock means for outputting time; and the means for writing the execution elapsed time to the time data storage means may read, when determined to be the command set and registered, the time from the clock means and write the read time to said storage means, and also acquires the elapsed time from a difference between the time read out by the clock means this time and the time stored last time so as to write the acquired time as the execution elapsed time.
A fifth form of the numerical control apparatus for controlling the machine tool according to the present invention comprises: means for setting and registering any command, selected from among a plurality of commands described in a command program handled by the numerical control apparatus, as an elapsed time data command for storing elapsed time; timekeeping means for measuring time; determination means for determining whether or not the command read from the command program during execution of the program is an elapsed time data command set and registered; time data storage means: and means for, when determined to be the elapsed time data command by the determination means, reading the measured time from the timekeeping means, apart from the execution of the original contents of the elapsed time data command, writing the read time to said time data storage means as execution elapsed time and resetting the timekeeping means to start time measuring.
As for the numerical control apparatuses in the first to fifth forms, it is possible to provide means for determining whether the original contents of the command set and registered are a program annotation portion itself or the command having the program annotation portion described in the same block as command, and means for, when determined to have the program annotation portion, writing a comment registered as program annotation portion together to the time data storage means. Furthermore, it is possible to comprise means for displaying the data to be stored by the time data storage means on a display unit of the numerical control apparatus. It is also possible to comprise communication means for outputting the data to be stored by the time data storage means from the numerical control apparatus to the outside.
According to the present invention, it is possible to provide the numerical control apparatus capable of easily checking the execution time of a desired program command.